<template>
  <div class="feed__item">
    <div class="feed__item__picture">
      <img v-lazy="item.cover">
    </div>
    <p class="feed__item__title">
      <span v-if="item.isHot" class="feed__item__title__hot__placeholder">HOT</span>
      {{ item.name }}
    </p>
    <div class="feed__item__detail">
      <div class="feed__item__detail__price">
        <span class="feed__item__detail__price__character">￥</span>{{ item.price }}
      </div>
      <div class="feed__item__detail__sales">{{ item.sales }}万人+付款</div>
    </div>
    <div class="feed__item__promotion">
      <div v-if="item.discount" class="feed__item__promotion__discount">
        每{{ item.discount.total }}减{{ item.discount.dis }}
      </div>
      <div v-if="item.isHot" class="feed__item__promotion__recommend">
        热门浏览
      </div>
      <div v-else />
      <img src="https://fast-learn.oss-cn-hangzhou.aliyuncs.com/tb/dash.svg" class="more">
    </div>
  </div>
</template>

<script >
export default {
  name: 'FeedItem',
  props: {
    item: {
      type: Object,
      default() {
        return {}
      }
    }
  }
}

</script>

<style lang="less" scoped>
.feed__item {
  background-color: #FFFFFF;
  border-radius: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  &__picture {
    width: 100% ;
    img {
      width: 100% ;
    }
  }
    img.more {
    width: 25px;
    height: 10px;
  }
  &__title {
    box-sizing: border-box;
    text-align: left;
    font-size: 24px;
    line-height: 36px;
    padding: 0 12px;
    margin-bottom: 6px;

    &__hot__placeholder {
      border-radius: 6px;
      color: #FFFFFF;
      background-color: #FE6026;
      padding: 0 6px;
    }
  }

  &__detail {
    display: flex;
    box-sizing: border-box;
    padding: 0 12px;
    text-align: left;
    line-height: 36px;

    &__price {
      color: #FE6026;
      font-size: 32px;

      &__character {
        font-size: 16px;
      }

      //
      //&__count {
      //  font-size: 32px;
      //}
    }

    &__sales {
      font-size: 16px;
      color: #9B9B9B;
      margin-left: 12px;
    }
  }

  &__promotion {
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    font-size: 24px;
    padding: 12px;

    &__discount {
      box-sizing: border-box;
      height: 32px;
      line-height: 32px;
      padding: 0 4px;
      color: #FE6026;
      border: 1px solid #FE6026;
      border-radius: 4px;
    }

    &__recommend {
      box-sizing: border-box;
      height: 32px;
      line-height: 32px;
      //padding: 4px;
      color: #CD7B00;
    }
  }
}
</style>
